package com.alex.controller;

import com.alex.entity.User;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;

@RestController
@RequestMapping("api")
@Api("Hello 控制类")
public class HelloController {

    @GetMapping("hello")
    @ApiOperation("你好")
    public String test01() {
        return "hello";
    }

    @GetMapping("user")
    @ApiOperation("获取用户信息")
    public User test02(@ApiParam("参数信息") String name) {
        return new User("1001","alex", "123");
    }

    @GetMapping("map")
    public HashMap<String, String> test03() {
        HashMap<String, String> map = new HashMap<>();
        map.put("email", "alex@126.com");
        return map;
    }
}
